<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{layout/commonRes::common('-数据字典编辑', false, false)}">
  <style>
      body {
          text-align: center
      }
  </style>
</head>
<body>
<div class="layui-card" id="dictionaryContent" style="width:650px;margin:0 auto">
  <div class="layui-card-body">
    <form class="layui-form" id="dictionaryForm">
      <input type="hidden" id="id" name="id" th:value="${dictionaryForm.id}">
      <div class="layui-form-item">
        <label class="layui-form-label">上级字典:</label>
        <div class="layui-input-inline">
          <select name="parentId" id="parentId" lay-verify="required" lay-search=""
                  th:field="*{dictionaryForm.parentId}">
            <option value="">--请选择--</option>
            <option th:each="enmu : ${parentList}" th:value="${enmu.value}" th:text="${enmu.name}"></option>
          </select>
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">字典编码</label>
        <div class="layui-input-block">
          <input type="text" name="dictValue" id="dictValue" lay-verify="required|isExist" lay-reqtext="编码不能为空"
                 placeholder="请输入编码" autocomplete="off" class="layui-input" th:value="${dictionaryForm.dictValue}">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">字典名称</label>
        <div class="layui-input-block">
          <input type="text" name="dictName" lay-verify="required" lay-reqtext="名称不能为空" placeholder="请输入名称"
                 autocomplete="off" class="layui-input" th:value="${dictionaryForm.dictName}">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">排序号</label>
        <div class="layui-input-block">
          <input type="text" name="orders" lay-verify="required" lay-reqtext="排序号不能为空" placeholder="请输入排序号"
                 autocomplete="off" class="layui-input" th:value="${dictionaryForm.orders}">
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">字典描述</label>
        <div class="layui-input-block">
          <textarea placeholder="请输入内容" class="layui-textarea" name="description"
                    th:value="${dictionaryForm.description}">[[${dictionaryForm.description}]]</textarea>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="updateDictionary"
                  id="saveBtn">保存
          </button>
          <button type="button" class="layui-btn layui-btn-primary layui-border-blue" onclick="closeTabs()">关闭</button>
        </div>
      </div>
    </form>
  </div>


  <script type="text/javascript" th:inline="javascript">
    var contextPath = [[${#httpServletRequest.getContextPath()}]];
  </script>
  <script type="text/javascript" th:src="@{/js/dictionary/dictEdit.js}"></script>
</body>
</html>
